package github.fafaovo.common.event;

import github.fafaovo.common.commands.*;
import github.fafaovo.common.config.exampleconfig;
import github.fafaovo.deepcapacity;
import net.minecraftforge.event.RegisterCommandsEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.server.command.ConfigCommand;

@Mod.EventBusSubscriber(modid = deepcapacity.MOD_ID)
public class CommandEvents {
    @SubscribeEvent
    public static void commandRegister(RegisterCommandsEvent event)
    {
        if(exampleconfig.gethand_boolean.get())
            new GetHandCommand(event.getDispatcher());
        if(exampleconfig.sethome_boolean.get())
            new SavePostionCommand(event.getDispatcher());
        if(exampleconfig.back_boolean.get())
            new BackPostionCommand(event.getDispatcher());


        new SetPowerCommand(event.getDispatcher());
        new SetWorldPowerCommand(event.getDispatcher());

        ConfigCommand.register(event.getDispatcher());
    }
}
